package com.zhentao.controller;

import com.zhentao.apis.producer.ProducerClientApi;
import com.zhentao.dto.UserDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Date 2024/3/27 10:27
 * @Author xdm
 **/

@RestController
@RequestMapping("/order")
public class OrdersController {

    @Autowired
    private ProducerClientApi producerClientApi;

    //添加订单的接口，添加订单的时候需要查询一下用户信息

    @GetMapping("/add")
    public String add(){
        System.out.println("订单添加");
        //查询用户
      String getVal=  producerClientApi.list();
      return "订单添加"+getVal;
    }

    @PostMapping("/add2")
    public String add2(@RequestBody UserDto userDto){
        System.out.println("订单添加");
        //查询用户
        String getVal=  producerClientApi.add(userDto);
        return "订单添加"+getVal;
    }


}



